1. Field of the Invention
The present invention relates to a decoding method for MR codes in a facsimile or the like.
2. Description of the Prior Art
In facsimiles, many encoding systems are used for transmitting picture information. Among these systems, the MH encoding system, the MR encoding system and the MMR encoding system are typical systems that are widely practical. An outline of these systems will be described as follows.
(1) MH encoding system . . . This encoding system utilizes correlation between neighboring picture elements in the main scan direction (the lateral direction) on the run length (the length of black or white continuing in one line, expressed by an integer) as represented by one or two MH codes. Code representing the last run length in one line is encoded by a (EOL) indicating the end of the line.
(2) MR encoding system . . . This encoding system utilizes correlation of picture elements not only in the main scan direction but also in the sub scan direction (the longitudinal direction). The run length of the immediately preceding line is compared with the run length of the line to be encoded, and encoding is carried out according to the change point data. However, the top line of the top page and each line per a defined number oflines (for example, per two lines in normal mode, per four lines in fine, per eight lines in super fine mode) are encoded using an MH encoding system. Code representing the last run length of one line is encoded by a code (EOL) representing the end of the line.
(3) MMR encoding system . . . Encoding from the first line of the page to the last line is carried out using an MR encoding system. However, when the top line of the page is encoded, an imaginary all white line is used as a reference line for comparing the change point. Consequently, at the receiving side, when the first line of the page is decoded, the decoding is carried out assuming that an all white line exists before the first line.
The MR code will be described in further detail. Regarding the present invention, since an MMR code may be treated the same as an MR code, the MMR code shall be included in the MR code in the following description.
The MR code is constituted by a combination of mode symbol and code representing its details. Since codes of variable length are constituted by a combination of "1" and "0", actual decoding is carried out by recognizing code data of "1" "0", but the following description shall be carried out by the mode symbol.
The MR code compares and represents the order relation, in the main scan direction, of points where picture elements are changed from white to black or from black to white (hereinafter referred to as "change points" regarding the reference line and the line to be encoded. The MR code includes a pass mode, a horizontal mode and a vertical mode, expressed by P, H, and V respectively. The mode symbol is V(0) regarding the part where the change points are the same with respect to both the reference line and the line to be encoded. For example, where the reference line and the line to be encoded have the same change points in white, black, white, black . . . , the mode symbols are expressed by V(0), V(0), V(0), . . . .
In an ordinary facsimile document, the ratio of V(0) appearing continuously is high, and in a detailed document, the frequency with which V(0) appears becomes even larger. Therefore, in the MR code, a code "1" (one bit being the shortest code) is allocated for the mode symbol of V(0). On the contrary, a code having a longer bit number is allocated for the mode symbol which appears less frequently.
Decoding of such MR code is carried out in that the MR code into run length code (RL code) indicating the length of continuing picture elements of white or black and then converting into bit data. In a manner similar to encoding, the decoding is carried out by using the immediately preceding line as a reference line. The reference line is data with the run length code (RL code) continuing, and the decoded data is stored in the line memory so as to decode the next line, and then becomes the reference line so as to decode next line.
Decoding in such manner is carried out also regarding the above-mentioned V(0) mode in similar manner to other mode, in repeating procedure that the picture element change point succeeding the reference line is read out from the line memory and decoded in sequence. Consequently, when the data number of one line is large, more time is required for the decoding and a large problem occurs in the high speed operation of the facsimile.